Copyright: Produced by WebTwin (www.webtwin.com) HTML->WinHelp converter.
Citation: Help file produced by WebTwin (www.webtwin.com) HTML->WinHelp converter. This text does not appear in the registered version.


The CGI Start-Up Guide

Welcome to this easy yet informative Perl/CGI tutorial. In this, I plan to

teach you how to install other people's CGI scripts and the basics of creating

your own. From there you can look at more examples and hopefully become an

excellent CGI scripter. You will find this language to be VERY useful if you are

in the web design field, or simply enjoy making web pages.  Please feel free to

contact me with questions...all of my info is at the bottom. I hope you enjoy

learning about the greatest programming language on the Internet. Have fun!

Sincerely,

Win Welsh

Please feel free to contact me:
E-mail: win@welsh.net
Web:    http://win.welsh.net

Next --->

[http://www.macrealm.com/cgi/startup.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The CGI Start-Up Guide

Table of Contents

(we reccomend you start with the first lesson!!!)

	How to Install CGI Scripts
	The Basic Print Script
	The Print Script With Scalars
	The Print Script With Scalars and HTML
	How to Handle Form Input
	The Form to E-mail Script
	UN|X Commands
	The Database Script
	Download ALL of the Examples Here!
[http://www.macrealm.com/cgi/toc.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


Installing CGI Scripts

Installing CGI Scripts

The only way we can learn is to write a script and put it on the Internet to test it out. Otherwise you have no way to test it out. Here are the steps to installing CGI scripts:

1. Get a CGI Bin
Get a web hosting account so you can run CGI scripts. You may already have one
with your free web space that comes with your ISP account. E-mail win@welsh.net to
set up a low priced web server for you.

2. Upload Your Script
If you do not know how to do this, you should not already be trying to learn CGI, but
the basics of the Internet. There are many sites that may aide you in this.

3. Log In With Telnet and Chmod 755 Your CGI File
Sometimes you can do this lengthy process through your FTP client also. Again, if
you do not know how to do this, search for CHMOD on the Internet.

4. Run the Script via Your Browser
Type in the URL of your uploaded file to test it out. If you do not get any errors, you
have done everything right. If you do get an error you probably did one of the above
steps wrong, or you have an error in the actual script. Look at the DEBUGGING
section of this file for more info.

Next --->

[http://www.macrealm.com/cgi/installing.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The Basic Print Script

The Basic PRINT Script

The first thing we need to learn are the basics of the language Perl, in which CGI is based on. Perl becomes CGI when it is used with the Internet, so there isn't much of a difference. First, let's create a simple script.

#!/usr/local/bin/perl

print "Content-type:text/html\n\n";
print "This is my first CGI Script!";

Okay, now that you've seen this exceptionally simple script, I'll explain
what each line means.

#!/usr/local/bin/perl -- This is ALWAYS required in EVERY CGI/Perl
script you do. It tells the location of Perl
on your server.

print "Content-type:text/html\n\n"; -- You don't know it, but every
HTML has this embedded into the text by
the web server to tell the browser that it
is an HTML document. You are simply saying
that with this line.

print "This is my first CGI Script!"; -- As you know, the PRINT command
prints a line of text into the document.
All you are doing here is telling the
script to print the sentence "This is
my first CGI Script!" into the HTML
document.

Now name this file "test.cgi" and follow all of the directions in the "Installing CGI Scripts" sections. It should work, if it doesn't e-mail me at win@welsh.net and I'll see what you did wrong. This script should display the following:

This is my first CGI Script!

Next --->

[http://www.macrealm.com/cgi/basicprint.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The Print Script With Scalars

The PRINT Script With Scalars

Now I will introduce another element of Perl called a Scalar. A scalar always starts with a $ sign. So that means it looks like this:
$scalar
Now, what does that mean to you? Well, you can assign values to each scalar variable which allows you to do many things, one of them we will demonstrate in this script.

#!/usr/local/bin/perl

$myscalar = "This is";

print "Content-type:text/html\n\n";
print $myscalar . " my first CGI Script!";

Okay, now that you've seen this script, I'll explain what each line means.

#!/usr/local/bin/perl -- You know, this is required in EVERY script!

$myscalar = "This is"; -- Sets the value of $myscalar to "This is"

print "Content-type:text/html\n\n"; -- Tells the browser it is an HTML
document.

print $myscalar . " my first CGI Script!"; -- Since $myscalar
is the same thing
 as "This is", this print statement
will mean exactly the same thing as
the original script.

Now name this file "test2.cgi" and follow all of the directions in the "Installing CGI Scripts" sections. It should work, if it doesn't e-mail me at win@welsh.net and I'll see what you did wrong. This script should display the following:

This is my first CGI Script!

Next --->

[http://www.macrealm.com/cgi/printscalar.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The Print Script With Scalars and HTML Tags

The PRINT Script With Scalars and HTML Tags

This script will introduce another method that can be used to create longer HTML files with CGI. This is what the print tag looks like with the new tag:

print "Content-type: text/html\n\n" ;

print <<EOF ;
<html>
<head><title>My CGI Script</title></head>
<body>
<h1>Isn't this cool???</h1>
</body>
</html>
EOF

This allows lengthy HTML to be printed just as usual. Now let's make a complex script with this new technique:

#!/usr/local/bin/perl

$title = "My CGI Script" ;
print "Content-type: text/html\n\n" ;

print <<EOF ;
<html>
<head><title>$title</title></head>
<body>
<h1>Isn't this cool???</h1>
</body>
</html>
EOF

Okay, now that you've seen this script, I'll explain what each line means.

#!/usr/local/bin/perl -- Required in every CGI script.

$title = "My CGI Script" ; -- Sets the value of $title to "My CGI Script"

print "Content-type: text/html\n\n" ; -- Tells what type of file it is.
print <<EOF ;                      -- You already know that this
<html>     -- statement allows you to
<head><title>$title</title></head> -- enter a whole block of HTML
<body>     -- into one print statement!
<h1>Isn't this cool???</h1>        -- This statement also excepts
</body>     -- scalars (as you can see in the
</html>     -- title).
EOF

This script should out put the following:

The title of you document should be "My CGI Script"

The body of the document should look like this:

Isn't this cool?

Next --->

[http://www.macrealm.com/cgi/printscalarhtm.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


How to Handle Form Input

How to Handle Form Input

When you submit a form to a CGI script, your info was encoded and sent to the script. It is up to the script to do the decoding and do something with what they sent. There is a special block of text used to decode the form input that must be placed somewhere in your script when you are doing so. It looks like this:

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
       @pairs = split(/&/, $buffer);

       foreach $pair (@pairs)
       {
           ($name, $value) = split(/=/, $pair);

           # Un-Webify plus signs and %-encoding
           $value =~ tr/+/ /;
           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

           # Stop people from using subshells to execute commands
           # Not a big deal when using sendmail, but very important
           # when using UCB mail (aka mailx).
           $value =~ s/~!/ ~!/g;

           $FORM{$name} = $value;
       }

Do not worry AT ALL about learning and memorizing that, I don't even know what a lot of it means! Just copy and paste this every time you are creating a script with form input. Now that you know the script, let me show you how to change each little form text box (that the user entered in) to a scalar variable with this script.

#!/usr/local/bin/perl

#########The Form Handler##########
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
       @pairs = split(/&/, $buffer);

       foreach $pair (@pairs)
       {
           ($name, $value) = split(/=/, $pair);

           # Un-Webify plus signs and %-encoding
           $value =~ tr/+/ /;
           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

           # Stop people from using subshells to execute commands
           # Not a big deal when using sendmail, but very important
           # when using UCB mail (aka mailx).
           $value =~ s/~!/ ~!/g;

           $FORM{$name} = $value;
       }
#########End Form Handler#########

$emailyou = "win\@welsh.net";
print "Content-type:text/html\n\n";
print "<h1>Thank you for filling out the form</h1>";

$firstname = $FORM{'1'};
$lastname = $FORM{'2'};
$email = $FORM{'3'};

print "Your first name is $firstname .<BR>";
print "Your last name is $lastname .<BR>";
print "Your e-mail is $email .<P>";
print "Contact <a href=\"mailto:$emailyou\">$emailyou</a> for more info.";

Now, as always, I will tell you what each line means.

#!/usr/local/bin/perl -- Needed in EVERY CGI script.

#########The Form Handler##########-- Everything between
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});these lines you don't
       @pairs = split(/&/, $buffer);  need to know, just
keep it for later.
       foreach $pair (@pairs)
       {
           ($name, $value) = split(/=/, $pair);

           # Un-Webify plus signs and %-encoding
           $value =~ tr/+/ /;
           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

           # Stop people from using subshells to execute commands
           # Not a big deal when using sendmail, but very important
           # when using UCB mail (aka mailx).
           $value =~ s/~!/ ~!/g;

           $FORM{$name} = $value;
       }
#########End Form Handler######### -- Done! You didn't need to know anything
above!!!

$emailyou = "win\@welsh.net";-- Sets this value to YOUR e-mail. Notice
that the @ sign is an illegal character so
the \ is needed before it.

print "Content-type:text/html\n\n";  -- Tells the browser what type of doc it
is.

print "<h1>Thank you for filling out the form</h1>"; -- Prints this HTML tag.

$firstname = $FORM{'1'}; -- I named each form area in the HTML fname,
lname, and email. So this means that when I
submitted the form, the value of "fname" was set
to what I entered in the HTML text box, and so on.
See the chart I drew at the bottom.

$lastname = $FORM{'2'}; -- Look at the text above.
$email = $FORM{'3'};    -- Look at the text above.

print "Your first name is $firstname .<BR>"; -- Prints what the user
print "Your last name is $lastname .<BR>";      submitted.
print "Your e-mail is $email .<P>";
print "Contact <a href=\"mailto:$emailyou\">$emailyou</a> for more info.";
-- Puts your e-mail at the bottom of the HTML Document.

Are You Confused???
Maybe this drawing wil help:

Thank you for filling out the form!

Your first name is <whatever you entered>.
Your last name is <whatever you entered>.
Your e-mail address is <whatever you entered>.

Contact <your e-mail address> for more info.

This is the HTML that you will use to submit the form:

<HTML>
<HEAD>
<TITLE>The Form Handler Script</TITLE>
</HEAD>

<BODY>

<FORM ACTION="http://www.yourserver.com/cgi-bin/test3.cgi" METHOD="POST">
<P>Firstname <INPUT TYPE="TEXT" NAME="1" SIZE="25"></P>

<P>Lastname <INPUT TYPE="TEXT" NAME="2" SIZE="25"></P>
<P>E-mail <INPUT TYPE="TEXT" NAME="3" SIZE="25"></P>

<P><INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Submit">
</FORM>

</BODY>

</HTML>

Next --->

[http://www.macrealm.com/cgi/formhandle.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


Creating a Form to E-mail Script

Creating a Form to E-mail Script

Now that you know how to accept user input and print with scalars, you have opened up a new door for your scripting abilities. Now I intend to show you how to create a script that e-mails the contents of a form to you.
This is a script that relies on you having special processes to handle sending the e-mail. This is going to be simple, you won't learn much because all of it is just cut n' paste.

#!/usr/local/bin/perl
#
#   mailer.pl-- A simple program to mail form data to an email address
#

# IMPORTANT: MAKE SURE THESE TWO VALUES ARE SET CORRECTLY FOR YOU!
$mailprog= "/usr/sbin/sendmail" ;
$recipient= "win\@welsh.net" ;      # make sure to \ escape the @

# Get the CGI input variables
%in= &getcgivars ;

# Open the mailing process
open(MAIL, "|$mailprog $recipient")
    || &HTMLdie("Couldn't send the mail (couldn't run $mailprog).") ;

# Print the header information
$ENV{'HTTP_REFERER'} || ($ENV{'HTTP_REFERER'}= "your Web site") ;
print MAIL "Subject: Form data from the Web\n\n",
           "The following data was entered at $ENV{'HTTP_REFERER'}:\n\n" ;

# Find length of longest field name, for formatting; include space for colon
$maxlength= 0 ;
foreach (keys %in) {
    $maxlength= length if length > $maxlength ;
}
$maxlength++ ;

# Print each CGI variable received by the script, one per line.
# This just prints the fields in alphabetical order.  To define your own
#   order, use something like
#     foreach ('firstname', 'lastname', 'phone', 'address1', ... ) {
foreach (sort keys %in) {

    # If a field has newlines, it's probably a block of text; indent it.
    if ($in{$_}=~ /\n/) {
        $in{$_}= "\n" . $in{$_} ;
        $in{$_}=~ s/\n/\n    /g ;
        $in{$_}.= "\n" ;
    }

    # comma-separate multiple selections
    $in{$_}=~ s/\0/, /g ;

    # Print fields, aligning columns neatly
    printf MAIL "%-${maxlength}s  %s\n", "$_:", $in{$_} ;
}

# Close the process and mail the data
close(MAIL) ;

# Print an HTML response to the user
print <<EOF ;
Content-type: text/html

<html>
<body>
<h3>Your data has been sent.</h3>
</body>
</html>
EOF

exit ;

#-------------- start of &getcgivars() module, copied in -------------

# Read all CGI vars into an associative array.
# If multiple input fields have the same name, they are concatenated into
#   one array element and delimited with the \0 character (which fails if
#   the input has any \0 characters, very unlikely but conceivably possible).
# Currently only supports Content-Type of application/x-www-form-urlencoded.
sub getcgivars {
    local($in, %in) ;
    local($name, $value) ;

    # First, read entire string of CGI vars into $in
    if ( ($ENV{'REQUEST_METHOD'} eq 'GET') ||
         ($ENV{'REQUEST_METHOD'} eq 'HEAD') ) {
        $in= $ENV{'QUERY_STRING'} ;

    } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
        if ($ENV{'CONTENT_TYPE'}=~ m#^application/x-www-form-urlencoded$#i) {
            $ENV{'CONTENT_LENGTH'}
                || &HTMLdie("No Content-Length sent with the POST request.") ;
            read(STDIN, $in, $ENV{'CONTENT_LENGTH'}) ;

        } else {
            &HTMLdie("Unsupported Content-Type: $ENV{'CONTENT_TYPE'}") ;
        }

    } else {
        &HTMLdie("Script was called with unsupported REQUEST_METHOD.") ;
    }

    # Resolve and unencode name/value pairs into %in
    foreach (split('&', $in)) {
        s/\+/ /g ;
        ($name, $value)= split('=', $_, 2) ;
        $name=~ s/%(..)/chr(hex($1))/ge ;
        $value=~ s/%(..)/chr(hex($1))/ge ;
        $in{$name}.= "\0" if defined($in{$name}) ;  # concatenate multiple vars
        $in{$name}.= $value ;
    }

    return %in ;

}

# Die, outputting HTML error page
# If no $title, use a default title
sub HTMLdie {
    local($msg,$title)= @_ ;
    $title || ($title= "CGI Error") ;
    print <<EOF ;
Content-type: text/html

<html>
<head>
<title>$title</title>
</head>
<body>
<h1>$title</h1>
<h3>$msg</h3>
</body>
</html>
EOF

    exit ;
}

Don't worry!!! I just gave this to you so you could see how it works...as you can see most of it does not have to be memorized, and the stuff that does you already know! I am not going to show you what each line means because this script is WAY to complicated for that.

So, what was the point? I wanted to show you a cool script, but there is also another reason. With you I am going to make a good improvement to this fairly primitive script.

Let's make it so when somebody submits an e-mail they see what they typed on the page that is returned to them!

# Print an HTML response to the user
print "Content-type: text/html
print "<html>" ;-- I simply changed
print "<body>" ;the response to
print "<h3>Contents of Your Submission.</h3>" ;this which displays
foreach $key (keys(%FORM)) {" ;all of what the
print "$key = $FORM{$key}" ;user submitted.
print "</body>" ;
print "</html>" ;

exit ;

Just insert this into the place where it says

# Print an HTML response to the user

and run it! You now have an excellent form 2 mail gateway!

Here is the HTML to run it:

<HTML>
<HEAD>
        <TITLE>The Form 2 Mail Script</TITLE>
</HEAD>

<BODY>

<FORM ACTION="http://www.yourserver.com/cgi-bin/form2mail.cgi" METHOD="POST">
<P>Firstname <INPUT TYPE="TEXT" NAME="fname" SIZE="25"></P>

<P>Lastname <INPUT TYPE="TEXT" NAME="lname" SIZE="25"></P>
<P>E-mail <INPUT TYPE="TEXT" NAME="email" SIZE="25"></P>

<P><INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Submit">
</FORM>

</BODY>

</HTML>

Next --->

[http://www.macrealm.com/cgi/form2mail.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


UN|X File Commands

UN|X File Commands

Opening and Closing Files With Perl
In Perl you can use Perl to create databases and many other things by allowing it to read, c lose, and write to files. Here are two basic commands you need to know:

Opening files in Perl
open ([FILE_HANDLE_NAME], "[filename]");

Closing files in Perl
close ([FILE_HANDLE_NAME]);

The FILE_HANDLE_NAME can be anything you want it to; it will be used to refer back to that document without typing out it's name.
Now let's make up a neat little script that will read a file, and print it onto a web browser window.

open (ADDRESSES, "address.dat");
       while ()
         {
         print "$_";
         }
       close (ADDRESSES);

It's that simple!!!

Writing and Appending to Files With Perl
When you plan on writing or appending to files, you need to know what to enter FIRST before you do anything.

Write this when you plan to write to the file:
open ([FILE_HANDLE_NAME], ">[filename]");

Write this when you plan to append to the file:
open ([FILE_HANDLE_NAME], ">>[filename]");

The FILE_HANDLE_NAME can be anything you want it to; it will be used to refer back to that document without typing out it's name.
Typically, when writing to a file, you use the print function. However, instead of printing to standard output, you would specify the filename to print to. Consider the following example:

open (TEMP_FILE, ">temp.file");
print TEMP_FILE "hello there\n";
close (TEMP_FILE);

The file "temp.file" will now have the solitary line:

hello there

Deleting, Renaming, and Setting Permissions of Files
Here are all of the different commands:

Use this when you want to delete a file:

unlink ("[filename]");

Write this when you want to rename the file:

rename ("[old_filename]", "[new_filename]");

Write this when you want to change the permission of a file:

chmod (0666, "filename");

Let's look at this sample script that would rename, change permission, and then delete "file.txt":

rename ("file.txt", "newfile.txt");
chmod (0777, "newfile.txt");
unlink ("newfile.txt");

Now with all of this out of the way, we can get back to making some CGI scripts!!!

Next --->

[http://www.macrealm.com/cgi/unxcomnds.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The Database Script

The Database Script

The HTML File
You only need one HTML file for this script, which displays a form. It is as follows:

<HTML>
<HEAD>
<TITLE>The Database Script</TITLE>
</HEAD>

<BODY>

<FORM ACTION="http://www.yourdomain.com/cgi-bin/dbase/saved.cgi" METHOD="POST">
<P>Name:<INPUT TYPE="TEXT" NAME="1" SIZE="25"></P>

<P>Sex: <INPUT TYPE="TEXT" NAME="2" SIZE="25"></P>
<P>Age: <INPUT TYPE="TEXT" NAME="3" SIZE="25"></P>
<P>E-mail: <INPUT TYPE="TEXT" NAME="4" SIZE="25"></P>

<P><INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Submit">
</FORM>

</BODY>

</HTML>

The Save Data Script
In this database script, we are going to have two scripts. One that saves the data entered by a form, and one that reads and displays it. Here is the one that saves it:

#!/usr/local/bin/perl

# Location of the opend.cgi script
$location = "http://www.macrealm.com/cgi-bin/dbase/opend.cgi";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
       @pairs = split(/&/, $buffer);

       foreach $pair (@pairs)
       {
           ($name, $value) = split(/=/, $pair);

           # Un-Webify plus signs and %-encoding
           $value =~ tr/+/ /;
           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

           # Stop people from using subshells to execute commands
           # Not a big deal when using sendmail, but very important
           # when using UCB mail (aka mailx).
           $value =~ s/~!/ ~!/g;

           $FORM{$name} = $value;
       }
open(DATA,">>data.txt");

print DATA "$FORM{'1'}|$FORM{'2'}|$FORM{'3'}|$FORM{'4'}\n";
close(DATA);
print "Location:$location\n\n";

As always, I will explain:

#!/usr/local/bin/perl
-- The above is always needed!

$location = "http://www.yourdomain.com/cgi-bin/open.cgi";
-- The above is where you need to type the location of the "open cgi"
that will read the data (we will create it after this)

--Everything between these two red lines is the form input handler
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
       @pairs = split(/&/, $buffer);

       foreach $pair (@pairs)
       {
           ($name, $value) = split(/=/, $pair);

           # Un-Webify plus signs and %-encoding
           $value =~ tr/+/ /;
           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

           # Stop people from using subshells to execute commands
           # Not a big deal when using sendmail, but very important
           # when using UCB mail (aka mailx).
           $value =~ s/~!/ ~!/g;

           $FORM{$name} = $value;
       }
--This is the end of the form input handler

open(DATA,">>data.txt");
-- The above opens the file "data.txt" to be appended to

print DATA "$FORM{'1'}|$FORM{'2'}|$FORM{'3'}|$FORM{'4'}\n";
close(DATA);
-- The above appends the data to the "data.txt" file

print "Location:$location\n\n";
-- The above sends the user to the CGI script that READS the data.txt

The Open Data Script
We have already seen the script that adds the data as we enter it, but what about reading data? Well, this script will take care of that:

#!/usr/local/bin/perl

$filename = "data.txt";

print "Content-type:text/html\n\n";
print "<html><head><title>Catalog Page</title></head><body>";

open(INF,$filename);
@indata = <INF>;
close(INF);

print "<table border=1>";
print "<tr><th>Name</th><th>Sex</th><th>Age</th><th>E-mail</th></tr>\n";
foreach $i (@indata) {
chop($i);
($name,$sex,$age,$email) = split(/\|/,$i);
print "<tr>";
print "<td>$name</td>";
print "<td>$sex</td>";
print "<td>$age</td>";
print "<td>$email</td>";
print "</tr>\n";
}
print "</table>";
print "</body></html>";

As always, I will explain:

#!/usr/local/bin/perl
-- Always needed!

$filename = "data.txt";
-- The filename of your data file

print "Content-type:text/html\n\n";
print "<html><head><title>Catalog Page</title></head><body>";
-- Writes the head and body tags to the HTML out put page

open(INF,$filename);
@indata = <INF>;
close(INF);
-- Opens data.txt and copies all of it into the @indata array and
closes the file

print "<table border=1>";
print "<tr><th>Name</th><th>Sex</th><th>Age</th><th>E-mail</th></tr>\n";
foreach $i (@indata) {
chop($i);
($name,$sex,$age,$email) = split(/\|/,$i);
print "<tr>";
print "<td>$name</td>";
print "<td>$sex</td>";
print "<td>$age</td>";
print "<td>$email</td>";
print "</tr>\n";
}
print "</table>";
print "</body></html>";
-- All of the above mainly separates the data, and displays each
section of data onto the web page

That's it! Simply create 3 files:
save.cgi
open.cgi
data.txt
and that HTML file at the top to send the new data

MAKE SURE that the data file is chmoded 777!!!!

Next --->

[http://www.macrealm.com/cgi/dbase.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The Scripting Examples You Can Download

The Scripting Examples You Can Download and View

Below are the scripts in a compressed format. You can download them in either a ZIPped format or an HQXed format. Have fun with them!!!

Macintosh - Download the whole collection here

PC - Download the whole collection here

See the examples online below!

The Basic Print Script

Print Script With Scalars

Print Script With Scalars and HTML

The Form Input Example

Form to E-mail Script

The Database Script

Next --->

[http://www.macrealm.com/cgi/ex.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The Form Handler Script

A form was here in the original HTML file

[http://www.macrealm.com/cgi/ex/forminput.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The Form 2 Mail Script

A form was here in the original HTML file

[http://www.macrealm.com/cgi/ex/form2mail.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


The Database Script

A form was here in the original HTML file

[http://www.macrealm.com/cgi/ex/dbase.html]

This help file was generated from HTML source using an unregistered copy of WebTwin version 1.1a


If you can see this, your help file has no topics! See the status tab and webtwin.log for more information.

Note that it is important that you exit WebTwin first to make sure the log file is up to date.

Be aware that restarting WebTwin will cause the log file to be emptied, so check it before restarting.


This URL was excluded from the pulldown


The protocol used in this URL is not at present supported by WebTwin


This URL referenced an unknown protocol


This link was broken when WebTwin tried to fetch it


This URL contained unknown content


Robots are excluded from this URL


This link was not retrieved


This link was skipped because it was suspected to be an invalid URL


This link was skipped at user request


This link was skipped it was suspected to be CGI. This can be changed from the WebTwin Options tab.


This link was skipped it was an image, and the NoImages option was on. This can be changed from the WebTwin Options tab.


This link was skipped because either the user pressed the WebTwin 'Enough' button or the given retrieval time limit expired.


Registration information goes here